feat(cli): check managed global outdated packages#1659
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
…arallel-npm-view # Conflicts: # crates/vite_global_cli/src/shim/dispatch.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f78fcfb73e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0959a422
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48d693cdad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6480105d81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| package.name.clone(), | ||
| OutdatedPackageJson { | ||
| current: package.current.clone(), | ||
| wanted: package.latest.clone(), |
There was a problem hiding this comment.
Keep npm-compatible
wanted value in global JSON output
The JSON formatter sets wanted to latest, but for global/out-of-package specs npm’s outdated schema reports wanted as the currently installed version. This makes vp outdated -g --format json semantically incompatible with npm consumers and can cause scripts to misinterpret upgrade intent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a little bit strange, I tested locally and it seems npm always prints latest as wanted, while the document says current should be wanted
% npm outdated -g
Package Current Wanted Latest Location Depended by
npm 11.13.0 11.15.0 11.15.0 node_modules/npm global
vue 2.0.0 3.5.34 3.5.34 node_modules/vue globalThere was a problem hiding this comment.
As well as JSON
{
"npm": {
"current": "11.6.2",
"wanted": "11.15.0",
"latest": "11.15.0",
"dependent": "global",
"location": "/Users/liangmi/.vite-plus/js_runtime/node/25.0.0/lib/node_modules/npm"
}
}There was a problem hiding this comment.
It is a problem on npm side. npm/cli#3612
There was a problem hiding this comment.
This can be resolved if npm/cli#9401 is in the proper way.
|
Manual validation found one regression in the all-globals outdated path. Repro on Windows from this PR head vp install -g testnpm2@1.0.0
vp pm list -g --json
vp outdated -g --format json
vp outdated testnpm2 -g --format jsonObserved:
Expected: Likely cause: |
|
This problem is caused by a wrong refactor, let me fix it, and thanks for testing. |
Implemented the outdated part of #1656 by routing
vp outdated -gthrough Vite+'s managed global package metadata instead of delegating to the underlyingnpm outdated -gstore.This PR includes a refactor for global package commands. This is intentional, taking into account that commands like
outdatedandinstallhave many shared utils, putting all of them insideenvmodule will reduce maintainability.Also modify
vp update -gto reuse the utilities added in this PR.🤖 Generated with Codex